package com.dubito.hiltdemo

import javax.inject.Inject

/**
 *author: liliang
 *date: 11/24/20 8:50 AM
 *
 */
class Truck @Inject constructor(val driver: Driver) {

    @BindElectricEngine
    @Inject
    lateinit var electricEngine: Engine

    @BindGasEngine
    @Inject
    lateinit var gasEngine: Engine

    fun deliver() {
        gasEngine.start()
        electricEngine.start()
        println("Truck is delivering cargo.$driver")
        gasEngine.shutdown()
        electricEngine.shutdown()
    }
}